<template>
<div class="news-detail">
  <my-header titleName="资讯详情"></my-header>
  <!-- 新闻详情 -->
  <div>
      <h1 class="news-title">{{newsdetaillist.title}}</h1>
      <p class="news-info">
        <span>{{newsdetaillist.add_time|filterTime}}</span>
        <span>{{newsdetaillist.click}}</span>
        <span>竞技</span>
      </p>
    </div>
    <div class="news-content" v-html="newsdetaillist.content"></div>
    <!-- 评论加载 -->
</div>
</template>
<script>
import { getNewsDetail } from '@/api'
import myHeader from '@/components/myHeader'
export default {
  components: {
    myHeader
  },
  data () {
    return {
      newsdetaillist: {},
      id: this.$route.params.id
    }
  },
  created () {
    this.initnewsDetail()
  },
  methods: {
    initnewsDetail () {
      getNewsDetail(this.id).then(res => {
        this.newsdetaillist = res.message[0]
        console.log(this.newsdetaillist)
      })
    }
  }
}
</script>
<style lang="less" scoped>
.news-detail {
  margin: 45px 0 0 0;
  .news-title {
    font-size: 14px;
    font-weight: bold;
  }
  .news-info {
    font-size: 12px;
    color: #26a2ff;
    display: flex;
    justify-content: space-between;
  }
  .news-content {
    font-size: 12px;
  }
}
</style>
